﻿USE [RestaurantManagement]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Nguyễn Đức Thắng>
-- Create date: <15/03/2013>
-- =============================================
CREATE PROCEDURE [dbo].[Get_All_RestaurantMenuCategories_ByCondition] 
	@WhereClause VARCHAR(MAX)
AS
BEGIN
	DECLARE @SQL VARCHAR(MAX)
	SET @SQL = 'select 	MenuCategoryID,
					MenuCategoryCode,
					IsParent,
					ParentID,
					MenuCategoryName,
					Description,
					IsActive,
					RestaurantID
				 from  dbo.[RestaurantMenuCategory]'
	IF (LEN(@WhereClause) > 0)
	BEGIN
		SET @SQL += @WhereClause
	END
	
	EXEC(@SQL)
END
